<div class="parent">
    <div class="child"></div>
  </div>
  <style>
    body {
      background-color: aqua;
    }
    .child {
      width: 50px;
      height: 50px;
      background-color: blueviolet;


      position: absolute;
      left:calc(50% - 25px);
      top:calc (50% - 25px)
    }
  </style>